<!DOCTYPE HTML>
<html  lang="zh" xmlns:th="http://www.thymeleaf.org">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="white-bg">
    <div id="formBox" class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-accept-edit" th:object="${payUserAll}">
            <input id="id" name="id" th:field="*{id}" class="form-control"  type="hidden">                                                                                                                                                                    <div class="form-group">
                <label class="col-sm-3 control-label">用户账号：</label>
                <div class="col-sm-8">
                    <input th:disabled="true" id="userLoginName" name="userLoginName" th:field="*{userLoginName}" class="form-control" type="text">
                </div>
            </div>
			<div class="form-group">
				<label class="col-sm-3 control-label">实名认证状态：</label>
				<div class="col-sm-8">
					<select th:disabled="true" name="certState" class="form-control m-b" th:with="type=${@dict.getType('pay_user_cert_state')}">
						<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{certState}"></option>
					</select>
				</div>
			</div>
            <div class="form-group">
                <label class="col-sm-3 control-label">支付宝账户：</label>
                <div class="col-sm-8">
                    <input th:disabled="true" id="zfbNo" name="zfbNo" th:field="*{zfbNo}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">支付宝姓名：</label>
                <div class="col-sm-8">
                    <input th:disabled="true" id="zfbName" name="zfbName" th:field="*{zfbName}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">支付宝二维码：</label>
                <div class="col-sm-8">
                    <img alt="" class="m-t-xs img-responsive" th:src="(${payUserAll.zfbImg} == '') ? @{/img/no_img.png} : @{/} + ${payUserAll.zfbImg}">
                </div>
            </div>
			<div class="form-group">
				<label class="col-sm-3 control-label">支付宝状态：</label>
				<div class="col-sm-8">
					<select name="zfbState" class="form-control m-b" th:with="type=${@dict.getType('pay_accout_zfb_state')}">
						<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{zfbState}"></option>
					</select>
				</div>
			</div>
            <div class="form-group">
                <label class="col-sm-3 control-label">微信账户：</label>
                <div class="col-sm-8">
                    <input th:disabled="true" id="wxNo" name="wxNo" th:field="*{wxNo}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">微信姓名：</label>
                <div class="col-sm-8">
                    <input th:disabled="true" id="wxName" name="wxName" th:field="*{wxName}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">微信二维码：</label>
                <div class="col-sm-8">
                    <img alt="" class="m-t-xs img-responsive" th:src="(${payUserAll.wxImg} == '') ? @{/img/no_img.png} : @{/} + ${payUserAll.wxImg}">
                </div>
            </div>
			<div class="form-group">
				<label class="col-sm-3 control-label">微信状态：</label>
				<div class="col-sm-8">
					<select name="wxState" class="form-control m-b" th:with="type=${@dict.getType('pay_accout_wx_state')}">
						<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{wxState}"></option>
					</select>
				</div>
			</div>
            <div class="form-group">
                <label class="col-sm-3 control-label">银行卡账号：</label>
                <div class="col-sm-8">
                    <input th:disabled="true" id="yhkNo" name="yhkNo" th:field="*{yhkNo}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">银行卡姓名：</label>
                <div class="col-sm-8">
                    <input th:disabled="true" id="yhkName" name="yhkName" th:field="*{yhkName}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">银行卡开户行：</label>
                <div class="col-sm-8">
                    <input th:disabled="true" id="yhkBank" name="yhkBank" th:field="*{yhkBank}" class="form-control" type="text">
                </div>
            </div>
			<div class="form-group">
				<label class="col-sm-3 control-label">银行卡状态：</label>
				<div class="col-sm-8">
					<select name="yhkState" class="form-control m-b" th:with="type=${@dict.getType('pay_accout_yhk_state')}">
						<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{yhkState}"></option>
					</select>
				</div>
			</div>
		</form>
    </div>
    <script th:src="@{/js/vue.min.js}"></script>
    <script th:src="@{/js/jquery.min.js}"></script>
    <script th:src="@{/js/ajaxupload.js}"></script>
    <div th:include="include::footer"></div>
    <script type="text/javascript">
        var prefix = ctx + "manager/user";
        var roleid = "3";
		$("#form-accept-edit").validate({
        rules:{
                        userLoginName:{
                            required:true,
                            minlength: 2,
                            maxlength: 20,
                            remote: {
                                url: ctx + "manager/user/checkLoginNameUnique",
                                type: "post",
                                dataType: "json",
                                data: {
                                    login_name : function() {
                                        return $.common.trim($("#userLoginName").val());
                                    }
                                },
                                dataFilter: function(data, type) {
                                    return $.validate.unique(data);
                                }
                            }
                        },
						accoutState:{
							required:true
						},
						acceptState:{
							required:true
						},
						yhkState:{
							required:true
						},
        },
        messages: {
            "userLoginName": {
                remote: "用户已经存在"
            }
        }
        });

		function submitHandler() {
	        if ($.validate.form()) {
                var id = $("input[name='id']").val();
                var zfbState = $("select[name='zfbState']").val();
                var wxState = $("select[name='wxState']").val();
                var yhkState = $("select[name='yhkState']").val();
                var params ='id='+id;
                params += '&zfbState=' + zfbState;
                params += '&wxState=' + wxState;
                params += '&yhkState=' + yhkState;
                $.operate.save(prefix + "/edit",params);
            }
        }
	</script>
</body>
</html>
